<?php
$this->breadcrumbs=array('Hangman'=>array('/hangman'),'Play',);
if (isset($error)) { 
echo("<h1><center><u>Lỗi hệ thống!</u></center></h1><br />\n");
echo("<h2>Error: $error</h2><br />\n");
}
else {
?>

<style type="text/css">

    .floatright {
        float: right;
        //font-size:0.9em;
	margin: 0px 0px 15px 30px;
	padding: 30px 30px;
	background:#000000;
                }
    .floatleft {
         float: left;
         margin: 30px 20px 15px 30px;
	 padding: 0px 0px;
	 //background:#ff00ff;
         //width: 500px;
                }
.errormessage {color: red;}
</style>

<h1><center><u>Thử tài trí nhớ!!!</u></center></h1><br />

<?php
echo("<div class='floatright'>\n");
echo("<img src='" . Yii::app()->request->baseUrl."/images/hangman/" . $title . ".jpg' height='300' width='350' /> <br />\n");
echo("<center><a href='" . Yii::app()->request->baseUrl . "/index.php/hangman/create'>" . '<font style="color: #ffffff ">' . "Tạo mới</font></a><br />"); 
echo("<a href='" . Yii::app()->request->baseUrl ."/index.php'>".'<font style="color: #ffffff ">'.'Quay lại trang chủ</font>'."</a><br /></center>"); 
echo("</div>\n");

echo("<div class='floatleft'>\n");
echo("<h2>\n"); 
echo("Đáp Án: $title <br /><br />\n"); 
echo("Tên diễn viên: $maskedTitle<br /><br />\n"); 
echo("Thất bại: $fails<br />\n"); 
echo("Đoán được: $guessed<br />\n"); 
echo("</h2>\n");
//echo("</div>\n");


if ($win) { echo("<br /><br /><center><h1>You Win!!!</h1></center><br />\n"); }
elseif ($lose) {
echo("<br /><br /><center><h1>You Lose :(</h1></center><br />\n"); 
echo("<h2>The answer was $title.</h2><br />\n"); 
}
else {
?>

<form name="guess_form" method="get">
<?php echo("<input type='hidden' name='token' value='$token'>\n"); ?>
    <h4>Đoán: &nbsp; <input type="text" name="guess" /></h4>
<input type="submit" value="Submit" />
</form> 
<?php
echo("<div class='errormessage'>\n");
echo("$message<br />\n");
echo("</div>\n");
}

echo("</div>\n");

}
?>